﻿@model Peninsula.DataAccess.POCO.RepairOrder
<div class="portlet">
	<div class="portlet-title">
		<div class="caption">
			<i class="fa fa-reorder"></i>订单详情
		</div>
		<div class="pull-right caption">
			<a href="@HttpContext.Current.Request.UrlReferrer"><i class="fa fa-reply"></i>返回</a>
		</div>
	</div>

	<div class="portlet-body ">
		<div class="panel-body">
			@{ 
				if (Model.Status == OrderStatus.Submitted)
				{
					<div class="panel-heading ">
						<a data-confirm-text="确定接单？" data-confirm-button="确定" data-cancel-button="取消"
							data-confirmed-url="@Url.Action("AcceptOrder", "StoreManger", new { id = Model.Id })" class="btn btn-lg btn-success  center-block js-table-ajax-confirm-button"
						 > 接单 </a>
					</div>
					<br />
					<hr />
				}
			}   
			<div class="panel-group">
				<label class="col-md-2">
					@Html.DisplayNameFor(m => m.Name):
				</label>
				<div class="col-md-7">
					@Html.DisplayFor(m => m.Name)
				</div>
			</div>
			<br />
			<hr />
			<div class="form-group-lg">
				<label class="col-md-2">
					@Html.DisplayNameFor(m => m.Description):
				</label>
				<div class="col-md-9">
					@*@Html.DisplayFor(m => m.Description)*@
					@Html.DisplayTextFor(m => m.Description)
				</div>
				<hr />
			</div>
			<br />
			<br />
			<hr />
			<div class="panel-group">
				<label class="col-md-2">
					@Html.DisplayNameFor(m => m.Status):
				</label>
				<div class="col-md-7">
					@Model.Status.EnumDescription()
				</div>
			</div>
			<br />
			<hr /> 
			<div class="panel-group">
				<label class="col-md-2">
					@Html.DisplayNameFor(m => m.Appointment):
				</label>
				<div class="col-md-7">
					@Html.DisplayFor(m => m.Appointment)
				</div>
			</div>
			<br />
			<hr />
			<div class="panel-group">
				<label class="col-md-2">
					@Html.DisplayNameFor(m => m.EndTime):
				</label>
				<div class="col-md-7">
					@{
						if (Model.Status == OrderStatus.RepairFinished || Model.Status == OrderStatus.HhouseholdToGoOut ||
							Model.Status == OrderStatus.AlreadyPaid || Model.Status == OrderStatus.Abandoned)
						{
							@Html.DisplayFor(m => m.EndTime)

						}
						else if ( Model.Status == OrderStatus.Received || Model.Status == OrderStatus.Sent
						   || Model.Status == OrderStatus.OnTheWay)
						{
							<p>订单维修中</p>
						}
						else
						{
							<p>订单未接取</p>
						}

					}
				</div>
			</div>
			<br />
			<hr />
			<div class="panel-group">
				<label class="col-md-2">
					@Html.DisplayNameFor(m => m.ItemTypeId):
				</label>
				<div class="col-md-7">
					@Model.ItemType.Name
				</div>
			</div>
			<br />
			<hr />
			<div class="panel-group">
				<label class="col-md-2">
					@Html.DisplayNameFor(m => m.Price):
				</label>
				<div class="col-md-7">
					@{
						if (Model.Status == OrderStatus.AlreadyPaid)
						{
							@Html.DisplayFor(m => m.Price)<p>（已付款）</p>
						}
						else if (Model.Status == OrderStatus.RepairFinished)
						{
							@Html.DisplayFor(m => m.Price)<p>（未付款）</p>
						}
						else if (Model.Status == OrderStatus.HhouseholdToGoOut)
						{
							 <p>户主外出，并未维修</p>
						}
						else if (Model.Status == OrderStatus.Submitted)
						{
							<p>订单未被接取</p>
						}
						else
						{
							<p>订单未维修完成</p>
						}
					}
				</div>
			</div>
			<br />
			<hr /> 
			<div class="panel-group">
				<label class="col-md-2">
					@Html.DisplayNameFor(m => m.MaintenanceStaffId):
				</label>
				<div class="col-md-7">
					@{
						if (Model.Status == OrderStatus.Submitted)
						{
							<p>订单未被接取</p>
						}
						else if (Model.MaintenanceStaffId.IsNullOrEmpty())
						{
							<p>订单未被派遣</p>
						}

						else
						{
							@Model.MaintenanceStaff.TrueName
						}
					}
				</div>
			</div>
			<br />
			<hr /> 
			<div class="panel-group">
				<label class="col-md-2">
					@Html.DisplayNameFor(m => m.SiteFiles):
				</label>
				<div class="col-md-7 " style="margin:0 auto;text-align:center">
					
					
							<table class="table  table-bordered k">
								@foreach (var item in Model.SiteFiles)
								{
									<tr>
										<td>
											<img src="@Url.Content(item.Path)" width="500px" height="350" class="center-block" />
										</td>
									</tr>
								}

							</table>
					
				  
				</div>
			</div>
		</div>
	</div>
</div>
